<?php

/**
 * @author HIENDV
 * @copyright 2012
 */
session_start();
include_once '../../../Model/Account.php';
$user = $_SESSION['username'];
$pass = $_SESSION['password'];
$username =$_REQUEST['username'];
$password = $_REQUEST['password'];
$first_name = $_REQUEST['first_name'];
$last_name = $_REQUEST['last_name'];
$birthday = $_REQUEST['birthday'];
$address = $_REQUEST['address'];
$mobi = $_REQUEST['mobi'];
$tell = $_REQUEST['tell'];
$sex = $_REQUEST['sex'];
$zoom_number = $_REQUEST['room_number'];
$email = $_REQUEST['email'];
$level = $_REQUEST['level'];
$fax = $_REQUEST['fax'];
$modified_date = $_REQUEST['modified_date'];
$created_date = $_REQUEST['created_date'];
$status = $_REQUEST['status'];
$created_by = $_REQUEST['created_by'];
$birthday= date("Y-m-d",strtotime($birthday));
$modified_date= date("Y-m-d",strtotime($modified_date));
$acc = new Account($user,$pass);
$result = $acc->edit_user_info($username,$password,$first_name,$last_name,
        $birthday,$address,$mobi,$tell,$sex,$zoom_number,$email,
        $level,$fax,$modified_date,$created_date,$status,$created_by);
if($result!='0'){
	$file='../../../../log/debug/'.date("y-m-d").'.txt';
	$f=fopen($file,'a+');
	if($f){
		fwrite($f,"ACCOUNT_EDIT_INFO_SUCCESS: ".$user." ".gmdate('Y-m-d H:i:s')."\r");
	}
}
else {
	$file='../../../../log/error/'.date("y-m-d").'.txt';
	$f=fopen($file,'a+');
	if($f){
		fwrite($f,"ACCOUNT_EDIT_INFO_ERROR: ".$user." ".gmdate('Y-m-d H:i:s')."\r");
	}

}
echo $result;
?>